//
//  MXHomePageView.m
//  Stratups
//
//  Created by 王启颖 on 2019/2/19.
//  Copyright © 2019 王启颖. All rights reserved.
//

#import "MXClockView.h"


@interface MXClockView ()
@property (weak, nonatomic) IBOutlet UIButton *clockBtn;
@property (weak, nonatomic) IBOutlet UILabel *clockLab;

@end
@implementation MXClockView

- (void)awakeFromNib {
    [super awakeFromNib];
    
    [self initCustomerControls];
}

-(void)setIsClock:(BOOL)isClock{
    _isClock = isClock;
    [self.clockBtn setSelected:isClock];
    if (isClock) {
        [self.clockBtn setUserInteractionEnabled:NO];
        self.clockLab.text = @"今日已经签到罗";
    }else{
        self.clockLab.text = @"今日还未签到，动起来";
    }
}

- (void)initCustomerControls {
    [self.clockBtn setImage:[UIImage imageNamed:@"勾"] forState:UIControlStateNormal];
    [self.clockBtn setImage:[UIImage imageNamed:@"勾_sel"] forState:UIControlStateSelected];
}

- (IBAction)clockClick:(UIButton *)sender {
//    self.clockBtn.selected = YES;
//    [self.clockBtn setUserInteractionEnabled:NO];
    
//    [self showWithPreview:YES];
    
    self.clockBlock();
    
}



+ (instancetype)initMXClockView {
    return NSbunleloadNibName(@"MXClockView");
}


@end
